package com.woniuxy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.entity.Cart;
import com.woniuxy.mapper.CartMapper;
import com.woniuxy.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CartServiceImpl extends ServiceImpl<CartMapper, Cart> implements CartService {
    @Autowired
    private CartMapper cartMapper;
    public List<Cart> getByCondition(Integer userId){
        return cartMapper.getByCondition(userId);
    };

    public Cart getByDish(Integer userId,Integer id){return cartMapper.getByDish(userId,id);};

    public int sel(int userid,int dishid){
       return cartMapper.sel(userid,dishid);
    };

    public Cart selCart(int userid,int dishid){
        return cartMapper.selCart(userid,dishid);
    };

    public void del(int id, int userid){
        cartMapper.del(id,userid);
    };
}
